package com.easy.customer.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.easy.common.bean.CustomerInteractions;
import com.easy.common.service.ICustomerInteractionsService;
import com.easy.customer.mapper.CustomerInteractionsMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CustomerInteractionsService implements ICustomerInteractionsService {
    @Autowired
    CustomerInteractionsMapper interactionMapper;
    @Override
    public CustomerInteractions insert(CustomerInteractions interaction) {
        interactionMapper.insert(interaction);
        return interaction;
    }

    @Override
    public CustomerInteractions update(CustomerInteractions interaction) {
        interactionMapper.updateById(interaction);
        return interaction;
    }

    @Override
    public IPage<CustomerInteractions> getListByPage(IPage page, CustomerInteractions interaction) {

        Wrapper wrapper=new QueryWrapper(interaction);
        IPage result=interactionMapper.selectPage(page,wrapper);
        return result;
    }

}
